package cn.source.zk.service.impl;

import cn.source.zk.domain.entity.FieldInfo;
import cn.source.zk.mapper.DbFieldInfoMapper;
import cn.source.zk.service.IDbFieldInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DbFieldInfoServiceImpl implements IDbFieldInfoService {

    @Autowired
    private DbFieldInfoMapper fieldInfoMapper;

    /**
     * 根据表明获取表的字段列表
     * @param tableName
     * @return
     */
    public List<FieldInfo>getFieldInfo(String tableName) {
        List<FieldInfo> list = fieldInfoMapper.getFieldInfo(tableName);
        return list;
    }

    /**
     * 根据字段获取注释
     * @param tableName
     * @param fieldName
     * @return
     */
    public String getCommentByField(String tableName, String fieldName) {


        return fieldInfoMapper.getCommentByField(tableName,fieldName);
    }
}
